#ifndef DBQUERYTHREAD_H
#define DBQUERYTHREAD_H

#include <QObject>
#include "cnsMacroGlobal.h"
#include <QThread>
#include "cnsComponent.h"
#include "dbquerybasethread.h"

class DbQueryThread : public DbQueryBaseThread {
    Q_OBJECT
public:
    Q_INVOKABLE DbQueryThread();
    virtual ~DbQueryThread() override;
};

CNS_COM_DECL_METATYPE(DbQueryThread)

class SysDbQueryThread : public QObject
{
    Q_OBJECT
public:
    Q_INVOKABLE SysDbQueryThread();

    Q_INVOKABLE void f_initDbQueryThread(CnsComponentPtr com, QVariantHash& props, QScopedPointer<QThread>& thread);

public slots:
    void stop(CnsComponentPtr com);
    bool f_query(CnsComponentPtr com, QString &dbID, QVariantHash &props);
};

Q_DECLARE_METATYPE(SysDbQueryThread*)

#endif  // DBQUERYTHREAD_H
